steam_send_screenshot

语法:

steam_send_screenshot(filename, width, height);


参数 描述
filename The name of the image file to upload (a string).
宽度 The width of the image (an integer).
高度 The height of the image (an integer).


返回: Real(实数)


描述

With this function you can upload a screenshot to the Steam Community profile page of the currently logged in user. The filename you supply is the name of the local file that was created when you took the screenshot using the GameMaker Studio 2 functions screen_save or screen_save_part. The width and height define the image size, and the function will return a value of 0 if it fails for whatever reason and a value greater than 0 if it succeeds.


例如:

if steam_is_screenshot_requested()
   {
   var file = "Catch_The_Haggis_" + string(global.scrn_num) + ".png");
   screen_save(file)
   steam_send_screenshot(file, window_get_width(), window_get_height());
   global.scrn_num += 1;
   }

The above code will poll the Steam API for a screenshot request and if it has been, a unique name for the image file will be generated, a screenshot will be taken, and the file will be sent to the Steam Community page for the user.